package com.hmy.finance.bo.request;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.hmy.ccp.common.request.BasePageRequest;
import com.hmy.finance.api.bo.core.request.enums.StatementTypeEnum;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
import javax.validation.Valid;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import lombok.Data;

/**
 * 对账管理-总营收相关汇总 / 设备拉取 入参
 */
@Data
public class ReceivablesDeviceQueryRequest extends BasePageRequest implements Serializable {

    private static final long serialVersionUID = -7849744102494848105L;

    /**
     * 账单类型:月结、期结、总账单
     * MONTHLY("1", "月结"),
     * PERIODIC("2", "期结"),
     * TOTAL("3", "总账单"),
     * FREE("4", "自由账单"),
     * FLEXIBLE("5","灵活账单"),
     * {@link StatementTypeEnum}
     */
    private String statementType;

    /**
     * 账单开始时间
     */
    @NotNull(message = "账单开始时间不能为空")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date statementStartTime;

    /**
     * 账单结束时间
     */
    @NotNull(message = "账单结束时间不能为空")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date statementEndTime;

    /**
     * 设备选取列表
     */
    @NotEmpty(message = "设备选取列表不能为空")
    @Valid
    private List<ContractDeviceDetailRequest> deviceDetails;

    private Boolean displayEntryShippingFee2Excel = Boolean.TRUE;

    private Boolean displayModificationFee2Excel = Boolean.TRUE;

    /**
     * 设备选取列表
     */
    @Data
    public static class ContractDeviceDetailRequest {

        /**
         * 设备租赁记录ID
         */
        private Long deviceRentalRecordId;
        
        /**
         * 合同编号
         */
        private String contractNo;

        /**
         * 合同id
         */
        @NotNull(message = "合同Id不能为空")
        private Long contractId;

        /**
         * 设备编号
         */
        private String deviceNo;

        /**
         * 设备id
         */
        @NotNull(message = "设备Id不能为空")
        private Long deviceId;

        /**
         * 账单开始时间
         */
        @NotNull(message = "设备账单开始时间不能为空")
        @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
        private Date setPreStartTime;

        /**
         * 账单结束时间
         */
        @NotNull(message = "设备账单结束时间不能为空")
        @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
        private Date setPreEndTime;
    }

}
